home *** CD-ROM | disk | FTP | other *** search
/ Visual FX for Image FX / VisualFX for Image FX 3.adf / Files / ARexx / 03 / 20.rexx < prev   
Encoding:
OS/2 REXX Batch file  |  1997-08-15  |  3.6 KB  |  178 lines

  1. /*
  2.                           Visual FX Arexx Script
  3.                            Written By J.L. White
  4.                          (C)1997 Merlin's Software
  5. */
  6.  
  7. Options Results
  8. address "IMAGEFX.1"
  9. ScreenToFront
  10. Undo Off
  11. Quotes = '27'X
  12. DQuotes = '22'X
  13.  
  14. if exists("libs:flyer.library") then do
  15.     TOASTERLIB="ToasterARexx.port"
  16.     call remlib('ToasterARexx.port')
  17.     call remlib('PROJECT_REXX_PORT')
  18.     call addlib('PROJECT_REXX_PORT' , 0)
  19.     call addlib(TOASTERLIB,0)
  20.     end
  21. call Settings()
  22. call open TempFile,"VFXIFX:TempDrawer/"FXNum".txt",R
  23. line = readln(TempFile)
  24. PicAName = strip(line)
  25. line = readln(TempFile)
  26. Start = strip(line)
  27. line = readln(TempFile)
  28. End = strip(line)
  29. line = readln(TempFile)
  30. IAType = strip(line)
  31. line = readln(TempFile)
  32. Speed = strip(line)
  33. call close TempFile
  34.  
  35. Frames = (End - Start)+1
  36. j=0
  37. k=0
  38. TFrames = Frames
  39. TNum = 3
  40. if TFrames > 999 then TNum = 4
  41. if TFrames > 9999 then TNum = 5
  42. if Field = 1 then TFrames = Frames*2
  43. do i = Start to End
  44.     k = k + 1
  45.     call open TempFile,"RAM:VFXNums",W
  46.     call writeln TempFile,right(k,5,'0')
  47.     call writeln TempFile,right(Frames,5,'0')
  48.     call close TempFile
  49.     f=0
  50.     Redraw Off
  51.     j = j+ 1
  52.     call DoIt()
  53.     Redraw On
  54.     call SaveIt()
  55.         if Field = 1 then do
  56.             Redraw Off
  57.             j = j + 1
  58.             call DoIt()
  59.             Redraw On
  60.             call SaveIt()
  61.             end 
  62.     end
  63.     Undo On
  64. exit
  65.  
  66.  
  67. LoadA:
  68.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  69.         Undo On
  70.         exit
  71.         end
  72.     if IAType = 0 then do
  73.         LoadBuffer PicAName Force i
  74.         if Field = 1 then do
  75.             GetMain
  76.             parse var result Name Width Height Blah
  77.             if FieldSet = 0 then do
  78.                 Hook DeInterlace
  79.                 Scale Width Height
  80.                 end
  81.             if FieldSet = 1 then do
  82.                 Hook DeInterlace
  83.                 Swap
  84.                 Scale Width Height
  85.                 end
  86.             end
  87.         end
  88.     if IAType = 1 then do
  89.         LoadBuffer PicAName Force 1
  90.         end
  91.     if IAType = 2 then do
  92.         LoadBuffer PicAName Force
  93.         end
  94.     if IAType = 3 then do
  95.         LoadBuffer PicAName""right(i,TNum,'0') Force
  96.         end
  97. return
  98.  
  99.  
  100.  
  101. SaveIt:
  102.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  103.         Undo On
  104.         exit
  105.         end
  106.     if SaveType = 0 then do
  107.         call Switcher(TOSW)
  108.         call Switcher(MDV1)
  109.  
  110.         Render Go
  111.         if Field = 1 then
  112.                 call RecordAdd(SaveName,1,6,Compression)
  113.         else
  114.                 call RecordAdd(SaveName,2,6,Compression)
  115.         if j = TFrames then
  116.             call MakeIcon(SaveName,(Frames-10))
  117.         end
  118.  
  119.     if SaveType = 1 then do
  120.         if Field = 1 then do
  121.             f= f + 1
  122.             if f = 1 then
  123.                 SaveBufferAs ILBM "VFXIFX:TempDrawer/PicA"
  124.             if f = 2 then do
  125.                 GetMain
  126.                 parse var result Name Width Height Blah
  127.                 Scale Width Height/2
  128.                 Swap
  129.                 LoadBuffer "VFXIFX:TempDrawer/PicA" Force
  130.                 Scale Width Height/2
  131.                 Hook Interlace
  132.                 SaveBufferAs ILBM SaveName""right(k,TNum,'0')
  133.                 f = 0
  134.                 end
  135.             end
  136.         else do
  137.             SaveBufferAs ILBM SaveName""right(k,TNum,'0')
  138.             end    
  139.         end
  140.  
  141. return
  142.  
  143.  
  144.  
  145.  
  146. DoIt:
  147.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  148.         Undo On
  149.         exit
  150.         end
  151.     call LoadA()
  152.     call open TempFile,"VFXIFX:TempDrawer/FireInfo."left(FXNum,2,''),R
  153.     do until eof(TempFile)
  154.         line = readln(TempFile)
  155.         parse var line Start" "RestOfLine
  156.         if Start = "Hook" then do
  157.             parse var line Blah" "Blah" "Seed" "Blah" "RestOfLine
  158.             Answer = RestOfLine
  159.             end
  160.         end
  161.     call close TempFile
  162.     Command2 = "Hook Fire" Seed ""Quotes||j*Speed||Quotes" "Answer
  163.     call open TempFile,"VFXIFX:TempDrawer/FireInfo."left(FXNum,2,''),W
  164.     call writeln TempFile,"/*"
  165.     call writeln TempFile," * Arexx Program created by ImageFX 2.0"
  166.     call writeln TempFile," */"
  167.     call writeln TempFile,""
  168.     call writeln TempFile,"Options Results"
  169.     call writeln TempFile,"address "DQuotes""IMAGEFX.1""DQuotes
  170.     call writeln TempFile,""
  171.     call writeln TempFile,Command2
  172.     call writeln TempFile,""
  173.     call close TempFile
  174.     address command "SYS:Rexxc/rx VFXIFX:TempDrawer/FireInfo."left(FXNum,2,'')
  175.  
  176. return
  177.  
  178.